#!/usr/bin/python
# -*- coding: UTF-8 -*-
__author__ = 'gtlions'


f = open('sortfile','r')
l = list()
for line in f.readlines():
    line = line.strip()
    if not len(line) or line.startswith("#"):
        continue
    l.append(line)
l.sort()
r = open('sortfile1','a')
r.write('%s' % '\n'.join(l))

f.close()
r.close()